package com.heima.search.config;

import com.heima.search.interceptor.SearchInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author xiaquanen
 * @version 1.0
 * @project heima-leadnews
 * @date 2024/7/21 16:41:18
 */
@Configuration
public class SearchInterceptorConfig implements WebMvcConfigurer {
    @Autowired
    private SearchInterceptor searchInterceptor;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(searchInterceptor).addPathPatterns("/**");
    }
}
